import React from 'react';
import IconBtn from './iconBtn.js';

class IconGroup extends React.Component {
	
	constructor(props) {
	  super(props);
	  this.state = {
	  	groups:[]
	  }
	}

	componentDidMount() {
		const groups = [
				{
					index: 1,
					name:'cloudcd',
					text:'山威云盘',
					icon:'',
					url:'https://www.baidu.com',
					target:"_blank"
				},
				{
					index: 2,
					name: 'publicode',
					text: '公众账号',
					icon: '',
					url: 'http://www.maksdu.com'
				},
				{
					index: 3,
					name: 'mypage',
					text: '我的收藏',
					icon: '',
					url: 'http://www.maksdu.com'
				}
			];
		this.setState({groups});
	}

	render() {
		return (
			this.state.groups.map(icon=>
					<IconBtn key={"icon_"+icon.index} btnname={icon.name} icon={icon.icon} 
					url={icon.url} text={icon.text} target={icon.target}/>
				)
			
		);
	}
}

export default IconGroup;